/* Streamlit/Gradio 风格美化 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    background: #f0f2f6;
}

.container {
    display: flex;
    height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 240px;
    background: white;
    padding: 20px;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}

.settings-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.history-card {
    margin-top: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.hidden {
    display: none;
}

/* 主界面样式 */
.main {
    flex: 1;
    padding: 30px;
    background: #f0f2f6;
}

.header {
    margin-bottom: 20px;
}

.chat-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    height: 65vh;
    overflow-y: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* 消息气泡 */
.message {
    margin: 10px 0;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 70%;
}

.message.user {
    background: #e3f2fd;
    margin-left: auto;
}

.message.assistant {
    background: #f1f3f4;
}

/* 按钮和输入框 */
.icon-button {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 5px;
}

.primary-button {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 12px 24px; /* 增大按钮尺寸 */
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 12px; /* 调整字体大小 */
}

.primary-button:disabled {
    background: #8ab4f8;
    cursor: not-allowed;
}

.secondary-button {
    background: #f8f9fa;
    color: #1a73e8;
    border: 1px solid #dadce0;
    padding: 12px 24px; /* 增大按钮尺寸 */
    border-radius: 6px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 12px; /* 调整字体大小 */
}

/* 新增表单组样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #5f6368;
    font-weight: 500;
}

/* 增强现有表单控件样式 */
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26,115,232,0.2);
}

/* 针对range类型的特殊样式 */
input[type="range"].form-control {
    padding: 8px 0;
    background: transparent;
}

/* 温度参数值显示样式 */
#temperature-value {
    display: inline-block;
    margin-left: 10px;
    min-width: 30px;
    text-align: center;
    font-size: 0.9em;
    color: #1a73e8;
}

/* 设置区域的子元素间距 */
.settings-card .form-group:last-child {
    margin-bottom: 0;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 0.85em;
        margin-bottom: 6px;
    }
    
    .form-control {
        padding: 8px 10px;
        font-size: 13px;
    }
}

.input-area {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* 历史记录项样式 */
#history-list li {
    padding: 10px;
    margin: 5px 0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

#history-list li:hover {
    background: #f1f3f4;
}

#history-list li small {
    color: #666;
    font-size: 0.8em;
}

#history-list li strong {
    display: block;
    margin-bottom: 2px;
}

/* 错误状态提示 */
.error {
    color: #dc3545;
    background: #ffe6e6 !important;
    padding: 10px;
    border-radius: 6px;
}

.empty {
    color: #6c757d;
    text-align: center;
    padding: 10px;
}

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: "加载中...";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}